package com.junzhiit.nengji.shop.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum GoodsHistoryAnalysisStatus {
	
	WEEK(0,"近7天"),
	MONTH(1,"近30天");
	
	private Integer value;
	private String text;

	private GoodsHistoryAnalysisStatus(Integer value,String text) {
		this.value = value;
		this.text = text;
	}

	public Integer toIntValue() {
		return this.value;
	}
	
	public String toStringText() {
		return this.text;
	}

	public static GoodsHistoryAnalysisStatus toStatus(Integer value) {
		if (WEEK.value == value) {
			return WEEK;
		} else if (MONTH.value == value) {
			return MONTH;
		}else {
			throw new InvalidArgumentException("Unknown OrderStatus[" + value + "].");
		}
	}
}
